package com.person.android.domain.adapters;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.person.android.dao.TransformRecordData;
import com.person.android.formatts.R;

import java.util.List;

/**
 * @autor zhaokang.
 * @time on 2015/12/15.
 */
public class TransformAdapter extends BaseAdapter {

    private Context mContext;
    private List<TransformRecordData> mDataList;
    public TransformAdapter(Context context,List<TransformRecordData> dataList){
        this.mContext = context;
        this.mDataList = dataList;
    }

    @Override
    public int getCount() {
        int size = 0;
        if (mDataList != null){
            size = mDataList.size();
        }
        return size;
    }

    @Override
    public Object getItem(int i) {
        return mDataList.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        if (view == null){
            view = LayoutInflater.from(mContext).inflate(R.layout.transform_item_layout,null);
        }
        return view;
    }
}
